package com.ruoyi.magazine.subscribe.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.magazine.subscribe.mapper.SubscribeMapper;
import com.ruoyi.magazine.subscribe.domain.Subscribe;
import com.ruoyi.magazine.subscribe.service.ISubscribeService;

/**
 * 订单与杂志的映射Service业务层处理
 *
 * @author duanxinli
 * @date 2023-11-13
 */
@Service
public class SubscribeServiceImpl implements ISubscribeService {
    @Autowired
    private SubscribeMapper subscribeMapper;

    /**
     * 查询订单与杂志的映射
     *
     * @param id 订单与杂志的映射主键
     * @return 订单与杂志的映射
     */
    @Override
    public Subscribe selectSubscribeById(String id) {
        return subscribeMapper.selectSubscribeById(id);
    }

    @Override
    public Subscribe selectSubscribeByOrderId(String orderId) {
        return subscribeMapper.selectSubscribeByOrderId(orderId);
    }

    /**
     * 查询订单与杂志的映射列表
     *
     * @param subscribe 订单与杂志的映射
     * @return 订单与杂志的映射
     */
    @Override
    public List<Subscribe> selectSubscribeList(Subscribe subscribe) {
        return subscribeMapper.selectSubscribeList(subscribe);
    }

    /**
     * 新增订单与杂志的映射
     *
     * @param subscribe 订单与杂志的映射
     * @return 结果
     */
    @Override
    public int insertSubscribe(Subscribe subscribe) {
        return subscribeMapper.insertSubscribe(subscribe);
    }

    /**
     * 修改订单与杂志的映射
     *
     * @param subscribe 订单与杂志的映射
     * @return 结果
     */
    @Override
    public int updateSubscribe(Subscribe subscribe) {
        return subscribeMapper.updateSubscribe(subscribe);
    }

    /**
     * 批量删除订单与杂志的映射
     *
     * @param ids 需要删除的订单与杂志的映射主键
     * @return 结果
     */
    @Override
    public int deleteSubscribeByIds(String[] ids) {
        return subscribeMapper.deleteSubscribeByIds(ids);
    }

    /**
     * 删除订单与杂志的映射信息
     *
     * @param id 订单与杂志的映射主键
     * @return 结果
     */
    @Override
    public int deleteSubscribeById(String id) {
        return subscribeMapper.deleteSubscribeById(id);
    }
}
